/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DTO;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;

/**
 *
 * @author Administrator
 */

// Tung goi du lieu cua cac sensor
public class SensorDTO implements Serializable{
    private String sensorSign = "";
    private int sensorCount;
    private String location;
    private Date creatTime ;
    private HashMap<String,Float> data ;    

    public SensorDTO(String sensorSign,int sensorCount,String location) {
        data = new HashMap<String, Float>();
        creatTime = new Date();
        this.sensorSign = sensorSign;
        this.location = location;
        this.sensorCount= sensorCount;
    }

       public String getSensorSign() {
        return sensorSign;
    }

    public void setSensorSign(String sensorSign) {
        this.sensorSign = sensorSign;
    }

    public HashMap<String, Float> getData() {
        return data;
    }

    public void setData(HashMap<String, Float> data) {
        this.data = data;
    }
    
    public void addData(String s, Float f) {
        this.data.put(s, f);
    }

    public Date getCreatTime() {
        return creatTime;
    }

    public void setCreatTime(Date creatTime) {
        this.creatTime = creatTime;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public int getSensorCount() {
        return sensorCount;
    }

    public void setSensorCount(int sensorCount) {
        this.sensorCount = sensorCount;
    }
    
    public void printData(){
        for(String i : this.data.keySet()) {
            System.out.println(i + " : " + this.data.get(i));
        }
    }

    
}
